<!DOCTYPE html>
<html>
<head>
<head>
<body>
    <pre><code id = 'output'></code></pre>
    <script>
        // 通知父窗口本窗口已准备就绪
        // window.opener.postMessage({ type: 'ready' }, '*');
        window.loaded = true;

        // 监听来自父窗口的消息
        window.addEventListener('message', function(event) {
            if (event.data.type === 'executeCode') {
                document.getElementById('output').textContent = event.data.code;
            }
        });
    </script>
</body>
</html>